#include<iostream>
using namespace std;
int main()
{
	int a;
    cin>>a;
	a = a + 2;
	if (a > 7)
		a = a - 7;
	cout << a;


	return 0;
}
